<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>查看采购订单</title>
<link href="<%=path%>/css/core.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/form.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/list.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/xWindowPanel.css" rel="stylesheet"
	type="text/css" />
<link href="<%=path%>/css/xToolbar.css" rel="stylesheet" type="text/css" />
<style type="text/css">
input {
	width: 180px;
}

textarea {
	width: 503px;
	height: 40px;
}

select {
	width: 188px;
}

.n {
	text-align: right;
}
</style>
</head>
<body>
	<s:if test="purchaseOrder.auditState == 2">
		<div id="toolbar"></div>
	</s:if>
	<div id="printArea">
		<div class="form-group">基本信息</div>
		<table class="form-table" cellspacing="0" cellpadding="0" width="100%">
			<tr>
				<td class="form-left">订单编号</td>
				<td class="form-right"><s:property value="purchaseOrder.code" />
				</td>
				<td class="form-left">发票编号</td>
				<td class="form-right"><s:property
						value="purchaseOrder.billCode" />
				</td>
			</tr>
			<tr>
				<td class="form-left">供应商</td>
				<td class="form-right"><s:property
						value="purchaseOrder.supplier.name" />
				</td>
				<td class="form-left">货源地址</td>
				<td class="form-right"><s:property
						value="purchaseOrder.sendAddress" />
				</td>
			</tr>
			<tr>
				<td class="form-left">采购日期</td>
				<td class="form-right"><s:date name="purchaseOrder.orderDate"
						format="yyyy-MM-dd" />
				</td>
				<td class="form-left">采购员</td>
				<td class="form-right"><s:property
						value="purchaseOrder.purchaser.name" />
				</td>
			</tr>
			<tr>
				<td class="form-left">备注</td>
				<td class="form-right" colspan="3"><s:property
						value="purchaseOrder.remark" />
				</td>
			</tr>
		</table>

		<div class="form-group">采购订单明细</div>
		<table id="titleTable" cellpadding="0" cellspacing="0">
			<tr>
				<td>货品编号</td>
				<td>货品名称</td>
				<td>规格型号</td>
				<td>生产商</td>
				<td>数量(个)</td>
				<td>单价(元)</td>
				<td>合计(元)</td>
			</tr>
		</table>
      <div style="overflow-y: scroll;height: 180px">
		<table id="dataTable" cellpadding="0" cellspacing="0">
			<s:iterator id="item" value="itemList" status="i">
				<tr class="row" id="<s:property value="#item.product.id"/>">
					<td><span><s:property value="#item.product.code" /> </span> <input
						type="hidden" name="itemList[__indexNum__].product.id"
						value="<s:property value="#item.product.id"/>" />
					</td>
					<td><span><s:property value="#item.product.name" /> </span></td>
					<td><span><s:property value="#item.product.standard" />
					</span></td>
					<td><span><s:property
								value="#item.product.manufacturer" /> </span></td>
					<td><span><s:property value="#item.amounts" /> </span></td>
					<td><span><s:property value="#item.price" /> </span></td>
					<td><span><s:property value="#item.lastPrice" /> </span></td>
				</tr>
			</s:iterator>
		</table>
      </div>
	</div>
	<script src="<%=path%>/js/core.js" type="text/javascript"></script>
	<script src="<%=path%>/js/jquery.js" type="text/javascript"></script>
	<script src="<%=path%>/js/Grid.js" type="text/javascript"></script>
	<script src="<%=path%>/js/jquery-impromptu.js" type="text/javascript"></script>
	<script src="<%=path%>/js/xToolbar.js" type="text/javascript"></script>
	<script src="<%=path%>/js/xToolbar.items.js" type="text/javascript"></script>
	<script type="text/javascript">
		var grid;

		$(document).ready(function() {
			new Toolbar({
				renderTo : 'toolbar',
				icon : '../../image/op.gif',
				border : 'both',
				items : [ {
					type : 'button',
					text : '打印',
					tip : '打印采购订单',
					useable : 'T',
					position : {
						a : '0px 0px',
						b : '0px -120px'
					},
					handler : function() {
						top.printOrder($("#printArea"));
					}
				} ]
			});
			grid = new Grid({
				titleTable : 'titleTable',
				dataTable : 'dataTable',
				widths : [ 120, 120, 100, 100, 65, 80, 95 ],
				height : 290
			});

			loadReady();
		});
	</script>
</body>
</html>